package com.ang.mybatisplus.sensitive.controller;

import com.ang.mybatisplus.sensitive.domain.SensitiveUser;
import com.ang.mybatisplus.sensitive.service.SensitiveUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 多种操作mysql传参方式，验证脱敏拦截器的拦截效果
 */
@RestController
@RequestMapping("/sensitive")
public class SensitiveEditController {
    @Autowired
    private SensitiveUserService sensitiveUserService;

    /**
     * 框架接口，QueryWrapper，Domain入参
     */
    @RequestMapping("/")
    public String queryWrapperDomain(){

        return "success";
    }

    /**
     * 框架接口，QueryWrapper，DTO入参
     */



    /**
     * 框架接口，Domain入参
     */
    @RequestMapping("/saveDomain")
    public String saveDomain(){
        SensitiveUser user = new SensitiveUser();
        user.setName("张三");
        user.setAge(25);
        user.setSex("男");

        sensitiveUserService.save(user);

        return "success";
    }

    /**
     * 自定义接口，Map入参
     */


}
